<%@page import="com.carrental.service.CarListService"%>
<%@page import="com.carrental.entity.CarList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加订单</title>
<style type="text/css">
	*{
		margin: 0;
		padding: 0;
	}
	
	html,body{
		width: 100%;
		height: 100%;
		background-color: #f2f2f2;
	}
	
	.head{
		width: 100%;
		height: 50px;
		line-height: 50px;
		background-color: #FA8258;
		color: #ffffff;
	}
	.head-content{
		width: 900px;
		margin: auto;
	}
	.head-content h2{
		float: left;
		margin-right: 10px;
	}
	.head-content a{
		float: left;
		margin-right: 10px;
	}
	.main{
		width: 100%;
	}
	.main-content{
		padding: 20px;
		width: 900px;
		margin: auto;
		background: #ffffff;
	}
	
	table{
		width: 50%;
	}
	table tr{
		height: 50px;
	}
	
	.select-button{
		width: 100px;
		height: 30px;
	}
</style>
</head>
<body>
	<div class="head">
		<div class="head-content">
			<h2>汽车租赁网</h2>
			<a href="index.jsp">首页</a>
			<a href="carRentalList.jsp">我的订单</a>
			<a href="userUpdate.jsp">个人信息</a>
			<a href="LogoutServlet">退出</a>
		</div>
	</div>
	<div class="main">
		<%
			String carId = request.getParameter("id");
			int num = Integer.parseInt(request.getParameter("num"));
			
			CarListService carListService = new CarListService();
			CarList carList = carListService.selectById(carId);
			
		%>
		<form class="main-content" action="carRentalAdd.jsp" method="post">
			<input name="id" type="text" value="<%=carId %>" hidden="hidden">
			<h2>选择数量和日期</h2>
			<table>
				<tr>
					<td>型号</td>
					<td><%=carList.getModel() %></td>
				</tr>
				<tr>
					<td>数量</td>
					<td>
						<input name="num" type="number" value="<%=num %>">
					</td>
				</tr>
				<tr>
					<td>开始日期</td>
					<td>
						<input name="startDatetime" type="date">
					</td>
				</tr>
				<tr>
					<td>结束日期</td>
					<td>
						<input name="endDatetime" type="date">
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;">
						<button class="select-button">确定</button>
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>